/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rational.parser.type.standart;

import java.math.BigDecimal;
import java.math.MathContext;
import org.rational.parser.type.wraps.TrimType;

/**
 *
 * @author Overmind
 */
public class Numeric
    extends TrimType<BigDecimal>
{   
    public Numeric()
    {
        super("Numeric");
    }
    
    @Override
    public BigDecimal valueOfTrimString(String string) throws
            NumberFormatException
    {
        return new BigDecimal(string);
    }

    @Override
    public String objectToString(BigDecimal value)
    {
        return value.round(MathContext.DECIMAL32).toString();
    }
}
